home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10455 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  43 lines

  1. Newsgroups: comp.lang.c++
  2. Path: vixen.cso.uiuc.edu!uchinews!not-for-mail
  3. From: magnus@darwin.uchicago.edu (Magnus Nordborg)
  4. Subject: template class as friend of instantiation class
  5. X-Nntp-Posting-Host: ntcs-ip8.uchicago.edu
  6. Content-Type: text/plain; charset=US-ASCII
  7. Message-ID: <960307221808.704AAFcQ.magnus@koa>
  8. Keywords: template, friend
  9. Sender: news@midway.uchicago.edu (News Administrator)
  10. Organization: University of Chicago -- Academic Computing Services
  11. X-Newsreader: Eloquent[2.01]; Eloquent is a Trademark of Take 3
  12. Mime-Version: 1.0 (Generated by Eloquent)
  13. Date: Fri, 8 Mar 1996 04:18:08 GMT
  14.  
  15. How do I accomplish the following?  I have a class, baseA, from which I
  16. derive
  17.  
  18. class A : public baseA.
  19.  
  20. I also have a template class, baseB, from which I derive
  21.  
  22. class B : public baseB<A>,
  23.  
  24. and B's members need access to the protected members of baseA.  In other
  25. words, how does one declare a template class to be a "friend" of the class
  26. used in the template instantiation?  Am I missing some obvious way, or is
  27. this obviously impossible?
  28.  
  29. Please email replies, and I will summarize.  Thanks in advance,
  30.  
  31.     -Magnus
  32. ---
  33. Magnus Nordborg
  34. Department of Ecology & Evolution
  35. The University of Chicago
  36. 1101 E. 57th St.
  37. Chicago, IL 60637-1573
  38. USA
  39. magnus@darwin.uchicago.edu (NeXT Mail, MIME)
  40. +1.312.702-1093 phone (lab)
  41. +1.312.667-5331 phone (home)
  42. +1.312.702-9740 fax
  43.